package com.flyme.excel.validator;

import com.ycc.vins.excel.ExcelCellValidator;
import com.ycc.vins.util.ValidateResult;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Nullable;

/**
 * Created by lijizhong on 2017/12/14.
 */

@Service
public class NotBlankCellValidator implements ExcelCellValidator{
    @Nullable
    @Override
    public ValidateResult apply(String s) {
        if (!org.apache.commons.lang3.StringUtils.isBlank(s)) {
            return ValidateResult.pass();
        }
        return StringUtils.isBlank(s) ? ValidateResult.notPass("不能为空!"): ValidateResult.pass();
    }
}
